package com.yihuan.service;

import com.yihuan.entity.MoneyEntity;
import com.yihuan.mapper.MoneyMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Author:梦醒
 * Date: 2022/5/6 8:42
 * Dream:
 * 信言不美，美言不信。
 * 善者不辩，辩者不善。
 * 知者不博，博者不知。
 * Function:
 */
@Service
public class MoneyService {
    @Resource
    MoneyMapper moneyMapper;
    
    /**
     * 注册每单获取的单价
     *
     * @param moneyEntity
     * @return
     */
    public int insertMoneyByMoneyData(MoneyEntity moneyEntity) {
        return moneyMapper.insertMoneyByMoneyData(moneyEntity);
    }
    
    /**
     * 计算每月份额
     *
     * @param moneyEntity
     * @return
     */
    public List<MoneyEntity> findMoneyBySumUserMoneyPrice(MoneyEntity moneyEntity) {
        return moneyMapper.findMoneyBySumUserMoneyPrice(moneyEntity);
    }
}
